package com.glacier.framework.component.dto.response;

/**
 * date 2023-12-22 16:58
 *
 * @author glacier
 * @version 1.0
 */
public enum BaseResponse implements ResponseCode {
    OK("200", "成功"),
    BAD_REQUEST("400", "请求错误"),
    UNAUTHORIZED("401", "未认证"),
    FORBIDDEN("403", "禁止访问"),
    NOT_FOUND("404", "未找到"),
    NOT_SUPPORTED("405", "请求不支持"),
    TIMEOUT("408", "超时"),
    INTERNAL_SERVER_ERROR("500", "服务器内部错误，无法完成请求"),
    BAD_GATEWAY("502", "Bad Gateway"),
    GATEWAY_TIMEOUT("504", "网关超时"),
    NULL_POINTER_EXCEPTION("600", "空指针异常"),
    PARAM_ERROR("601", "参数错误"),

    ;

    private final String code;
    private final String message;

    BaseResponse(String code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
